home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2009 February / PCWFEB09.iso / Software / Linux / Kubuntu 8.10 / kubuntu-8.10-desktop-i386.iso / casper / filesystem.squashfs / etc / X11 / Xsession.d / 90gpg-agent < prev    next >
Text File  |  2008-10-23  |  591b  |  20 lines

  1. : ${GNUPGHOME=$HOME/.gnupg}
  2.  
  3. GPGAGENT=/usr/bin/gpg-agent
  4. PID_FILE="$GNUPGHOME/gpg-agent-info-$(hostname)"
  5.  
  6. if grep -qs '^[[:space:]]*use-agent' "$GNUPGHOME/gpg.conf" "$GNUPGHOME/options" &&
  7.    test -x $GPGAGENT &&
  8.    { test -z "$GPG_AGENT_INFO" || ! $GPGAGENT 2>/dev/null; }; then
  9.  
  10.    if [ -r "$PID_FILE" ]; then
  11.        . "$PID_FILE"
  12.    fi
  13.  
  14.    # Invoking gpg-agent with no arguments exits successfully if the agent
  15.    # is already running as pointed by $GPG_AGENT_INFO
  16.    if ! $GPGAGENT 2>/dev/null; then
  17.        STARTUP="$GPGAGENT --daemon --sh --write-env-file=$PID_FILE $STARTUP"
  18.    fi
  19. fi
  20.